<template>
	<view class="content">
		<view class="wid100 " :style="'background-image: url('+(duan == 1?theme.tech_back_img:theme.my_back_img)+');'"
			style="height: 422rpx;box-sizing: border-box;background-size: 100% 100%;">
			<!-- #ifdef APP -->
			<!-- 状态栏高度 -->
			<view :style="{'height': statusBarHeight + 'px'}"></view>
			<view class="fowe600 coFFF dis disAl disJuC" style="height: 44px;">{{duan == 1?'技师端':'我的'}}</view>
			<view style="height: 50rpx;"></view>
			<!-- #endif -->

			<!-- #ifdef H5 -->
			<view style="height: 100rpx;"></view>
			<!-- #endif -->

			<view v-if="!userinfo" class="wid90 mar dis disAl disJuB" @click="tiaozhuan('/pages/login/wxLogin')">
				<view class="wid25" style="height: 138rpx;">
					<image src="../../static/tu3.png" class="borRad50"
						style="width: 130rpx;height: 130rpx;border: 4rpx solid #fff;"></image>
				</view>
				<view class="coFFF" style="width: 75%;">
					<view class="dis disAl disJuB">
						<view class="foSi50 fowe600" style="line-height: 50rpx;">请登录</view>
						<image src="../../static/shezhi.png" style="width: 30rpx;height: 30rpx;"></image>
					</view>
				</view>
			</view>
			<view v-if="userinfo" class="wid90 mar dis disAl disJuB">
				<view class="wid25" style="height: 138rpx;" v-if="duan == 0">
					<image v-if="!userinfo.avatar" src="../../static/tu3.png" class="borRad50"
						style="width: 130rpx;height: 130rpx;border: 4rpx solid #fff;"></image>
					<image v-if="userinfo.avatar" :src="userinfo.avatar" class="borRad50"
						style="width: 130rpx;height: 130rpx;border: 4rpx solid #fff;"></image>
				</view>
				<view class="wid25" style="height: 138rpx;" v-if="duan == 1">
					<image v-if="!tech_info.coverimg" src="../../static/tu3.png" class="borRad50"
						style="width: 130rpx;height: 130rpx;border: 4rpx solid #fff;"></image>
					<image v-if="tech_info.coverimg" :src="tech_info.coverimg" class="borRad50"
						style="width: 130rpx;height: 130rpx;border: 4rpx solid #fff;"></image>
				</view>
				<view class="coFFF" style="width: 75%;">

					<block v-if="duan == 1">
						<view class="dis disAl disJuB">
							<view>
								<view class="foSi50 fowe600 yclh" style="line-height: 50rpx; width: 220px;">
									{{tech_info.name}}</view>
								<view class="foSi30 mar-top15" style="line-height: 50rpx;">{{tech_info.phone}}</view>
							</view>
							<image src="../../static/shezhi.png" @click="renzheng()"
								style="width: 30rpx;height: 30rpx;"></image>
						</view>
						<view class="dis disAl mar-top15">
							<view class="dis disAl disJuC foSi20 borRad10" @click="renzheng()" style="width: 100rpx;height: 35rpx;background-color: #BFF1CA;"
								:style="'color: '+theme.main_color+';'">
								{{tech_info.is_auth == 1 ? '已认证' :'未认证'}}</view>
							<view class="dis disAl disJuC foSi20 borRad10 mar-left20" style="width: 100rpx;height: 35rpx;background-color: #BFF1CA;"
								:style="'color: '+theme.main_color+';'">
								{{tech_info.accept_orders == 1 && tech_info.empower == 1 ? '可服务' : '暂停服务'}}</view>
						</view>
					</block>
					<block v-if="duan == 0">
						<view class="dis disJuB" style="align-items: flex-end;">
							<view class="foSi50 fowe600 yclh" style="line-height: 50rpx; width: 220px;">
								{{userinfo.nickname}}</view>
							<image src="../../static/shezhi.png" @click="tiaozhuan('/pages/wode/install')"
								style="width: 30rpx;height: 30rpx;"></image>
						</view>
						<view class="dis mar-top20">
							<view class="borRad40 dis disAl div">
								<!-- <image src="../../static/huanyuan.png" style="width: 24rpx;height: 22rpx;"></image> -->
								<uni-icons custom-prefix="iconfont" size="30rpx" :color="theme.main_color"
									type="icon-quanjudengjiguanli"></uni-icons>
								<view class="foSi20" :style="'color: '+theme.main_color+';'" style="margin-left: 8rpx;">{{userinfo.label_text}}
								</view>
							</view>
						</view>
					</block>
				</view>
			</view>
		</view>

		<block v-if="duan == 1">
			<view class="wid90 mar borRad20 bacFFF"
				style="box-shadow: 0rpx 5rpx 10rpx 0rpx rgba(0,0,0,0.1);margin-top: -50rpx;">
				<view class="wid90 mar dis disAl disJuB" style="height: 97rpx;" v-if="tech_info.auth_status == 2">
					<view class="dis disAl">
						<view class="borRad40 dis disAl disJuC foSi18"
							style="background-color: #BFF1CA;width: 80rpx;height: 32rpx;">
							<uni-icons type="location-filled" size="20rpx" :color="theme.main_color"></uni-icons>
							<span :style="'color: '+theme.main_color+';'" style="margin-left: 4rpx;line-height: 28rpx;">当前</span>
						</view>
						<view class="mar-left10 foSi20 " style="color: #737373;">{{tech_info.address}}</view>
					</view>
					<view class="dis disAl foSi18">
						<view style="color: #737373;">实时定位</view>
						<switch :checked="dingwei" :color="theme.main_color" style="transform:scale(0.6)" @click="res_location" />
					</view>
				</view>
				<view class="wid90 mar dis disAl disJuB" style="height: 97rpx;" v-else>
					<view class="dis disAl">
						<view class="borRad40 dis disAl disJuC foSi18" :style="'background: '+theme.main_color+'21;'"
							style="width: 80rpx;height: 32rpx;">
							<uni-icons type="location-filled" size="20rpx" :color="theme.main_color"></uni-icons>
							<span :style="'color: '+theme.main_color+';'" style="margin-left: 4rpx;line-height: 28rpx;">提示</span>
						</view>
						<view class="mar-left10 foSi20 " style="color: #737373;">当前账号未认证无法接单</view>
					</view>
					<view class="dis disAl foSi18">
						<view style="padding: 5px 10px;border-radius: 10px;color: #fff;"
						 :style="'background: '+theme.main_color+';'" @click="renzheng()">去认证</view>
					</view>
				</view>
			</view>
			<view class="wid90 mar borRad20 bacFFF borRad20 mar-top40"
				@click="tiaozhuan('/pages/technician/allocation')"
				style="box-shadow: 0rpx 5rpx 10rpx 0rpx rgba(0,0,0,0.1);">
				<view class="wid90 mar">
					<view style="height: 10rpx;"></view>
					<view class="dis disAl disJuB" style="padding: 20rpx 0;border-bottom: 1px solid #E5E5E5;">
						<view>
							<view class="foSi25" style="line-height: 41rpx;">可提现（元）</view>
							<view class="fowe600 mar-top20 foSi40" style="line-height: 41rpx;">{{tech_info.money}}
							</view>
						</view>
						<view class="dis disAl disJuC foSi25 coFFF borRad40" :style="'background: '+theme.main_color+';'"
							@click.stop="tiaozhuan('/pages/partner/withdraw?id='+tech_info.id+'&shenfen=1')"
							style="width: 150rpx;height: 56rpx;">我要提现</view>
					</view>
					<view class="dis disAl " style="height: 96rpx;line-height: 41rpx;">
						<view class="foSi25">待结算金额（元）</view>
						<!-- 就是技师接单后正在服务中订单所分成的佣金 -->
						<view class="fowe600 mar-left20 foSi40">{{tech_info.commission}}</view>
					</view>
				</view>
			</view>
			<view class="wid90 mar bacFFF borRad20 mar-top40"
				style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0,0,0,0.1);padding: 30rpx 0;">
				<view class="wid90 mar">
					<view class="dis disAl fowe600 foSi30">更多功能</view>
					<view style="height: 10rpx;"></view>
					<view class="dis disAl flwa foSi22">
						<view class="textCen mar-top30 wid25" @click="tiaozhuan('/pages/technician/indent/indent')">
							<view class="dis disAl disJuC" style="height: 52rpx;">
								<!-- <image src="../../static/y_dingdan.png" style="width: 36rpx;height: 44rpx;"></image> -->
								<uni-icons custom-prefix="iconfont" size="50rpx" :color="theme.main_color"
									type="icon-dingdanguanli"></uni-icons>
							</view>
							<view class="textCen mar-top10">订单管理</view>
						</view>
						<view class="textCen mar-top30 wid25">
							<view class="dis disAl disJuC" style="height: 52rpx;">
								<uni-icons custom-prefix="iconfont" size="50rpx" :color="theme.main_color"
									type="icon-yejiguanli"></uni-icons>
								<!-- <image src="../../static/y_yjph.png" style="width: 41rpx;height: 42rpx;"></image> -->
							</view>
							<view class="textCen mar-top10">业绩管理</view>
						</view>
						<view class="textCen mar-top30 wid25" @click="tiaozhuan('/pages/technician/grade')">
							<view class="dis disAl disJuC" style="height: 52rpx;">
								<uni-icons custom-prefix="iconfont" size="50rpx" :color="theme.main_color"
									type="icon-huiyuandengjiguanli"></uni-icons>
								<!-- <image src="../../static/y_hydj.png" style="width: 47rpx;height: 42rpx;"></image> -->
							</view>
							<view class="textCen mar-top10">等级管理</view>
						</view>
						<view class="textCen mar-top30 wid25" @click="tiaozhuan('/pages/technician/fare')">
							<view class="dis disAl disJuC" style="height: 52rpx;">
								<uni-icons custom-prefix="iconfont" size="50rpx" :color="theme.main_color"
									type="icon-tanhuishangchefenqi"></uni-icons>
								<!-- <image src="../../static/y_xfjl.png" style="width: 38rpx;height: 46rpx;"></image> -->
							</view>
							<view class="textCen mar-top10">车费明细</view>
						</view>
						<view class="textCen mar-top30 wid25"
							@click="tiaozhuan('/pages/partner/withdraw?id='+tech_info.id+'&shenfen=1&type=2')">
							<view class="dis disAl disJuC" style="height: 52rpx;">
								<uni-icons custom-prefix="iconfont" size="50rpx" :color="theme.main_color"
									type="icon-for-close-account"></uni-icons>
								<!-- <image src="../../static/y_tx.png" style="width: 46rpx;height: 46rpx;"></image> -->
							</view>
							<view class="textCen mar-top10">车费提现</view>
						</view>
						<!-- <view class="textCen mar-top30 wid25">
							<view class="dis disAl disJuC" style="height: 52rpx;">
								<image src="../../static/y_xingcheng.png" style="width: 36rpx;height: 40rpx;"></image>
							</view>
							<view class="textCen mar-top10">行程记录</view>
						</view> -->
						<view class="textCen mar-top30 wid25" @click="tiaozhuan('/pages/technician/feedback')">
							<view class="dis disAl disJuC" style="height: 52rpx;">
								<uni-icons custom-prefix="iconfont" size="50rpx" :color="theme.main_color"
									type="icon-yichangshensu"></uni-icons>
								<!-- <image src="../../static/y_shensu.png" style="width: 47rpx;height: 46rpx;"></image> -->
							</view>
							<view class="textCen mar-top10">差评申诉</view>
						</view>
						<view class="textCen mar-top30 wid25"
							@click="tiaozhuan('/pages/technician/dynamically/dynamically')">
							<view class="dis disAl disJuC" style="height: 52rpx;">
								<uni-icons custom-prefix="iconfont" size="50rpx" :color="theme.main_color"
									type="icon-ziyuan100"></uni-icons>
								<!-- <image src="../../static/y_dongtai.png" style="width: 47rpx;height: 47rpx;"></image> -->
							</view>
							<view class="textCen mar-top10">动态发布</view>
						</view>
						<view class="textCen mar-top30 wid25" @click="tiaozhuan('/pages/technician/setTime')">
							<view class="dis disAl disJuC" style="height: 52rpx;">
								<uni-icons custom-prefix="iconfont" size="50rpx" :color="theme.main_color"
									type="icon-shijianguanli"></uni-icons>
								<!-- <image src="../../static/y_sjgl.png" style="width: 47rpx;height: 43rpx;"></image> -->
							</view>
							<view class="textCen mar-top10">时间管理</view>
						</view>
						<view class="textCen mar-top30 wid25" @click="baojing()">
							<view class="dis disAl disJuC" style="height: 52rpx;">
								<uni-icons custom-prefix="iconfont" size="50rpx" :color="theme.main_color"
									type="icon-yijianbaojing"></uni-icons>
								<!-- <image src="../../static/y_yjbj.png" style="width: 42rpx;height: 44rpx;"></image> -->
							</view>
							<view class="textCen mar-top10">一键报警</view>
						</view>
						<view class="textCen mar-top30 wid25" @click="tiaozhuan('/pages/shield/shield')">
							<view class="dis disAl disJuC" style="height: 52rpx;">
								<uni-icons custom-prefix="iconfont" size="50rpx" :color="theme.main_color"
									type="icon-pingbiyonghu"></uni-icons>
								<!-- <image src="../../static/y_pingbi.png" style="width: 45rpx;height: 45rpx;"></image> -->
							</view>
							<view class="textCen mar-top10">屏蔽用户</view>
						</view>
						<view class="textCen mar-top30 wid25" @click="qiehuan(0)">
							<view class="dis disAl disJuC" style="height: 52rpx;">
								<uni-icons custom-prefix="iconfont" size="50rpx" :color="theme.main_color"
									type="icon-spa"></uni-icons>
								<!-- <image src="../../static/y_qhyh.png" style="width: 41rpx;height: 46rpx;"></image> -->
							</view>
							<view class="textCen mar-top10">切换用户端</view>
						</view>
					</view>
					<view style="height: 10rpx;"></view>
				</view>
			</view>
		</block>
		<block v-if="duan == 0">
			<view class="wid87 mar borRad20" style="padding: 35rpx 0;background-color: #DEBE8B;margin-top: -90rpx;">
				<view class="wid90 mar dis disAl disJuB">
					<view class="fowe600">
						<view class="foSi25">我的余额</view>
						<view class="foSi35 mar-top20" style="vertical-align: bottom;color: #735530;">
							<span>¥</span>
							<span class="fowe600 foSi50">{{userinfo.money || 0.00}}</span>
						</view>
					</view>
					<view class="dis disAl disJuC foSi25 borRad10" @click="tiaozhuan('/pages/recharge/recharge')"
						style="width: 165rpx;height: 55rpx;border: 4rpx solid #735530;color: #6B4D29;">立即充值</view>
				</view>
			</view>
			<view class="wid87 mar mar-top30 dis disAl disJuB">
				<view class="borRad20" @click="tiaozhuan('/pages/wode/collect')"
					style="width: 48%;box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0,0,0,0.1);padding: 30rpx 0;">
					<view class="wid80 mar dis disAl disJuB">
						<view>
							<view class="foSi30 fowe600">我的收藏</view>
							<view class="foSi22 mar-top10" style="color: #737373;">
								已收藏{{userinfo.technician_collect_num || 0}}人</view>
						</view>
						<image src="../../static/shoucang.png" style="width: 75rpx;height: 75rpx;"></image>
					</view>
				</view>
				<view class="borRad20" @click="tiaozhuan('/pages/wode/coupon')"
					style="width: 48%;box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0,0,0,0.1);padding: 30rpx 0;">
					<view class="wid80 mar dis disAl disJuB">
						<view>
							<view class="foSi30 fowe600">我的优惠券</view>
							<view class="foSi22 mar-top10" style="color: #737373;">{{userinfo.coupon_num || 0}}张优惠券
							</view>
						</view>
						<image src="../../static/youhuijuan.png" style="width: 74rpx;height: 74rpx;"></image>
					</view>
				</view>
			</view>
			<view class="wid87 mar mar-top20" style="height: 172rpx;"
				@click="tiaozhuan('/pages/partner/technicianInvit')">
				<image src="../../static/yaoxin2.png" class="wh100"></image>
			</view>
			<view class="wid87 mar mar-top20 borRad20" style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0,0,0,0.1);">
				<view class="wid90 mar hei80 dis disAl disJuB">
					<view class="fowe600 foSi30">我的订单</view>
					<view class="dis disAl foSi25" @click="tiaozhuan('/pages/indent/indent?xuan=0')">
						<view class="mar-right10">全部订单</view>
						<uni-icons type="right" size="25rpx"></uni-icons>
					</view>
				</view>
				<view class="wid100" style="height: 1rpx;background-color: #E5E5E5;"></view>
				<view class="dis disAl foSi22" style="height: 138rpx;">
					<view class="wid20 dis disJuC" @click="tiaozhuan('/pages/indent/indent?xuan=1')">
						<view>
							<view class="wid100 dis disAl disJuC">
								<uni-icons custom-prefix="iconfont" size="40rpx"
									type="icon-dingdanzhuangtai-"></uni-icons>
								<!-- <image src="../../static/daizhifu1.png" class="wh100"></image> -->
							</view>
							<view class="mar-top20 textCen">待支付</view>
						</view>
					</view>
					<view class="wid20 dis disJuC" @click="tiaozhuan('/pages/indent/indent?xuan=2')">
						<view>
							<view class="wid100 dis disAl disJuC">
								<uni-icons custom-prefix="iconfont" size="40rpx"
									type="icon-dingdanzhuangtai-1"></uni-icons>
								<!-- <image src="../../static/daifuwu1.png" class="wh100"></image> -->
							</view>
							<view class="mar-top20 textCen">待服务</view>
						</view>
					</view>
					<view class="wid20 dis disJuC" @click="tiaozhuan('/pages/indent/indent?xuan=3')">
						<view>
							<view class="wid100 dis disAl disJuC">
								<uni-icons custom-prefix="iconfont" size="40rpx"
									type="icon-dingdanzhuangtai-2"></uni-icons>
								<!-- <image src="../../static/fuwuzhong1.png" class="wh100"></image> -->
							</view>
							<view class="mar-top20 textCen">服务中</view>
						</view>
					</view>
					<view class="wid20 dis disJuC" @click="tiaozhuan('/pages/indent/indent?xuan=4')">
						<view>
							<view class="wid100 dis disAl disJuC">
								<uni-icons custom-prefix="iconfont" size="40rpx"
									type="icon-dingdanzhuangtai-3"></uni-icons>
								<!-- <image src="../../static/daipingjia1.png" class="wh100"></image> -->
							</view>
							<view class="mar-top20 textCen">待评价</view>
						</view>
					</view>
					<view class="wid20 dis disJuC" @click="tiaozhuan('/pages/indent/indent?xuan=5')">
						<view>
							<view class="wid100 dis disAl disJuC">
								<uni-icons custom-prefix="iconfont" size="40rpx"
									type="icon-dingdanzhuangtai-4"></uni-icons>
								<!-- <image src="../../static/tuikuan1.png" class="wh100"></image> -->
							</view>
							<view class="mar-top20 textCen">退款/售后</view>
						</view>
					</view>
				</view>
			</view>
			<view class="wid87 mar mar-top20 borRad20" style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0,0,0,0.1);">
				<view class="wid90 mar hei80 dis disAl fowe600 foSi30">其他功能</view>
				<view class="wid100 mar-bott30" style="height: 1rpx;background-color: #E5E5E5;"></view>
				<view class="dis disAl foSi22 flwa">
					<view class="wid25 dis disJuC mar-bott30" @click="hehuo()">
						<view>
							<view class="wid100 dis disAl disJuC">
								<uni-icons custom-prefix="iconfont" size="50rpx" :color="theme.main_color"
									type="icon-hehuoren"></uni-icons>
								<!-- <image src="../../static/fenxiao1.png" class="wh100"></image> -->
							</view>
							<view class="mar-top10 textCen">申请合伙人</view>
						</view>
					</view>
					<view class="wid25 dis disJuC mar-bott30" @click="daili()">
						<view>
							<view class="wid100 dis disAl disJuC">
								<uni-icons custom-prefix="iconfont" size="50rpx" :color="theme.main_color"
									type="icon-dailishang"></uni-icons>
								<!-- <image src="../../static/fenxiaoshang.png" class="wh100"></image> -->
							</view>
							<view class="mar-top10 textCen">申请代理商</view>
						</view>
					</view>
					<view class="wid25 dis disJuC mar-bott30" @click="jishi()">
						<view>
							<view class="wid100 dis disAl disJuC">
								<uni-icons custom-prefix="iconfont" size="50rpx" :color="theme.main_color"
									type="icon-tech"></uni-icons>
								<!-- <image src="../../static/jishi.png" class="wh100"></image> -->
							</view>
							<view class="mar-top10 textCen">申请技师</view>
						</view>
					</view>
					<view class="wid25 dis disJuC mar-bott30" @click="tiaozhuan('/pages/wode/address')">
						<view>
							<view class="wid100 dis disAl disJuC">
								<uni-icons custom-prefix="iconfont" size="50rpx" :color="theme.main_color"
									type="icon-dizhiguanli"></uni-icons>
								<!-- <image src="../../static/dizhi1.png" class="wh100"></image> -->
							</view>
							<view class="mar-top10 textCen">地址管理</view>
						</view>
					</view>
					<view class="wid25 dis disJuC mar-bott30" @click="tiaozhuan('/pages/wode/feedback')">
						<view>
							<view class="wid100 dis disAl disJuC">
								<uni-icons custom-prefix="iconfont" size="50rpx" :color="theme.main_color"
									type="icon-wentifankui"></uni-icons>
								<!-- <image src="../../static/fankui.png" class="wh100"></image> -->
							</view>
							<view class="mar-top10 textCen">申诉/退款</view>
						</view>
					</view>
					<view class="wid25 dis disJuC mar-bott30" @click="boda">
						<view>
							<view class="wid100 dis disAl disJuC">
								<uni-icons custom-prefix="iconfont" size="50rpx" :color="theme.main_color"
									type="icon-lianxikefu"></uni-icons>
								<!-- <image src="../../static/kefu2.png" class="wh100"></image> -->
							</view>
							<view class="mar-top10 textCen">联系客服</view>
						</view>
					</view>
					<!-- <view v-if="userinfo.tech_id" class=" dis disJuC mar-bott30 wid25" @click="jishi()">
						<view>
							<view class="mar" style="width: 41rpx;height: 46rpx;">
								<image src="../../static/y_qhyh.png" class="wh100"></image>
							</view>
							<view class="mar-top10 textCen">切换技师端</view>
						</view>
					</view> -->
				</view>
			</view>
			<view style="margin-top: 60rpx;">
				<view class="dis disAl disJuC">
					<image src="../../static/tuijian.png" style="width: 29rpx;height: 34rpx;"></image>
					<view class="mar-left10 foSi30 fowe600">附近技师</view>
				</view>
				<view style="height: 10rpx;"></view>
				<block v-for="(item,index) in list.slice(0, 10)" :key="index">
					<view class="wid90 mar mar-top30 borRad10"
						@click="tiaozhuan('/pages/technician/particulars?id='+item.id)"
						style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0,0,0,0.1);">
						<view style="height: 25rpx;"></view>
						<view class="wid90 mar">
							<view class="dis disAl">
								<view class="wid25">
									<image :src="item.coverimg" style="width: 100rpx;height: 100rpx;" class="borRad50">
									</image>
								</view>
								<view style="height: 100rpx;border-bottom: 1rpx solid #E1DFDF;width: 75%;">
									<view class="dis disAl disJuB">
										<view class="dis disAl">
											<view class="foSi30 fowe600">{{item.name}}</view>
											<view class="dis disAl disJuC foSi15 coFFF mar-left20" :style="'background: '+theme.seco_color+';'"
												style="width: 80rpx;height: 28rpx;border-radius: 5rpx;">
												更多照片</view>
										</view>
										<view :style="'color: '+theme.main_color+';background-color: '+theme.main_color+'21;'"
											style="width: 146rpx;height: 28rpx;border-radius: 5rpx;"
											class="dis disAl disJuC foSi15 fowe600">最早可约：{{item.start_time}}</view>
									</view>
									<view class="mar-top20 dis disAl disJuB">
										<view class="dis disAl">
											<image src="../../static/pingjia.png"
												style="width: 25rpx;height: 25rpx;margin-right: 5rpx;"></image>
											<view class="foSi25 fowe600" style="color: #FEC44A;">{{item.star}}</view>
											<view
												style="width: 2rpx;background-color: #BFBFBF;height: 22rpx;margin: 0 15rpx;">
											</view>
											<view class="foSi20 fowe600">已服务<span
											 :style="'color: '+theme.main_color+';'">{{item.service_order_num}}</span>单</view>
										</view>
										<view class="dis disAl">
											<uni-icons type="location-filled" size="30rpx" :color="theme.main_color"></uni-icons>
											<view class="foSi25 mar-left10">{{item.km}}</view>
										</view>
									</view>
								</view>
							</view>
							<view class="dis disAl" style="height: 76rpx;">
								<view class="wid25">
									<view style="width: 100rpx;">
										<view class="mar dis disAl disJuC borRad40 coFFF foSi15" :style="'background: '+theme.main_color+';'"
											style="width: 80rpx;height: 29rpx;">
											{{item.status == 1?'可服务':item.status == 2?'服务中':'可预约'}}</view>
									</view>
								</view>
								<view class="dis disAl disJuB" style="width: 75%;">
									<view class="dis disAl">
										<view class="dis disAl">
											<image src="../../static/pinglu1.png" style="width: 24rpx;height: 24rpx;">
											</image>
											<view class="mar-left10 fowe600 foSi25">{{item.comment_num}}</view>
										</view>
										<view class="dis disAl mar-left30" @click="shouchang(index)">
											<!-- <image src="../../static/xihuan.png" style="width: 34rpx;height: 31rpx;"></image> -->
											<uni-icons v-if="item.collect == 2" type="star-filled" size="30rpx"
												:color="theme.main_color"></uni-icons>
											<uni-icons v-if="item.collect == 1" type="star" size="30rpx"
												color="#737373"></uni-icons>
											<view class="mar-left10 foSi25">{{item.coll_num}}</view>
										</view>
										<view class="dis disAl mar-left30">
											<image src="../../static/xiangqing.png" style="width: 22rpx;height: 24rpx;">
											</image>
											<view class="mar-left10 fowe600 foSi20">详情</view>
										</view>
									</view>
									<view class="dis disAl disJuC coFFF foSi20" :style="'background: '+theme.seco_color+';'"
										style="width: 120rpx;height: 42rpx;border-radius: 5rpx;">
										立即预约</view>
								</view>
							</view>
						</view>
					</view>
				</block>
				<view style="height: 50rpx;"></view>
			</view>
		</block>
		<view style="height: 160rpx;" :style="{'padding-bottom': paddingBottomHeight + 'rpx'}"></view>
		<tablist :back="theme.main_color" :datalist="datalist" :index="4"></tablist>
	</view>
</template>

<script>
	import tablist from "../common/tablist/tablist.vue"
	export default {
		components: {
			tablist
		},
		data() {
			return {
				url: this.global.url,
				list: [],
				dingwei: false,
				userinfo: '',
				duan: 0,
				timer: null,
				// 技师端数据
				tech_info: {},
				theme: null,
				datalist: [],
				paddingBottomHeight: 0,
				statusBarHeight: 0
			}
		},
		created() {
			let that = this;
			uni.hideTabBar()
			uni.getSystemInfo({
				success: function (res) {
					let model = ['X', 'XR', 'XS', '11', '12', '13', '14', '15'];
					model.forEach(item => {
						//适配iphoneX以上的底部，给tabbar一定高度的padding-bottom
						if(res.model.indexOf(item) != -1 && res.model.indexOf('iPhone') != -1) {
							that.paddingBottomHeight = 40;
						}
					})
				}
			});
		},
		onLoad() {
			/* 
			模拟用户已经登录
			 */
			let that = this
			this.statusBarHeight = uni.getSystemInfoSync()['statusBarHeight']
			this.datalist = uni.getStorageSync('bom')
			this.theme = uni.getStorageSync('theme')
			if (this.dingwei) {
				this.timer = setInterval(function() {
					that.getDeingwei()
				}, 10000);
			}
			this.duan = uni.getStorageSync('duan');
		},
		onShow() {
			// uni.setStorageSync('token','20240816084402-468525') //贾
			// uni.setStorageSync('token','20240808115645-844284') //杨
			this.dingwei = uni.getStorageSync('dingwei') ? uni.getStorageSync('dingwei') : false
			this.getUser()
			this.getJishiList()
			if (uni.getStorageSync('switch_tech')) {
				this.duan = 1
				uni.setStorageSync('switch_tech', null)
			}
		},
		methods: {
			shouchang(index) {
				var that = this;
				if (!uni.getStorageSync('token')) {
					return uni.showToast({
						title: '请登录',
						icon: 'error',
						duration: 2000
					})
				}
				var type = that.list[index].collect == 1 ? 2 : 1
				uni.request({
					url: that.global.url + 'api/qianyu_smfw/trends/collect_add',
					method: "POST",
					header: {
						'site-id': that.global.site_id, //自定义请求头信息
						'token': uni.getStorageSync('token')
					},
					data: {
						tech_id: that.list[index].tech_id,
						type: that.list[index].collect
					},
					success(res) {
						let result = res.data
						if (result.code == 1) {
							that.list[index].collect = type
							if (type == 2) {
								that.list[index].coll_num += 1
							} else {
								that.list[index].coll_num -= 1
							}
						} else {
							uni.showToast({
								title: result.msg,
								//将值设置为 success 或者直接不用写icon这个参数
								icon: 'error',
								//显示持续时间为 2秒
								duration: 2000
							})
						}
					}
				})
			},
			boda() {
				var tel = uni.getStorageSync('platform').service_tel
				uni.makePhoneCall({
					phoneNumber: tel
				})
			},
			renzheng() {
				console.log('认证')
				if (this.tech_info.auth_status == 1) {
					uni.showToast({
						title: "审核中...",
						//将值设置为 success 或者直接不用写icon这个参数
						icon: 'error',
						//显示持续时间为 2秒
						duration: 2000
					})
				} else {
					this.tiaozhuan('/pages/technician/authen')
				}
			},
			getJishiList() {
				var that = this;
				uni.request({
					url: that.global.url + 'api/qianyu_smfw/technician/lists',
					method: "POST",
					header: {
						'site-id': that.global.site_id, //自定义请求头信息
						'token': uni.getStorageSync('token')
					},
					data: {
						city: uni.getStorageSync('city').id,
						lon: uni.getStorageSync('lon') ? uni.getStorageSync('lon') : 125.35043,
						lat: uni.getStorageSync('lat') ? uni.getStorageSync('lat') : 43.86414,
						status: 1,
						page: 1
					},
					success(res) {
						let result = res.data
						if (result.code == 1) {
							that.list = result.data.data
						} else {
							uni.showToast({
								title: result.msg,
								//将值设置为 success 或者直接不用写icon这个参数
								icon: 'error',
								//显示持续时间为 2秒
								duration: 2000
							})
						}
					}
				})

			},
			qiehuan(index) {
				this.duan = index
				uni.setStorageSync('duan', index);
			},
			res_location() {
				this.dingwei = !this.dingwei
				uni.setStorageSync('dingwei', this.dingwei)

				if (this.dingwei) {
					// 1. 用uni自带的getlocation获取位置
					this.timer = setInterval(function() {
						this.getDeingwei()
					}, 10000);
				} else {
					clearTimeout(this.timer);
					this.timer = null;
				}
			},
			getDeingwei() {
				var that = this
				uni.getLocation({
					type: 'wgs84',
					success: async (res) => {
						console.log('获取的经纬度')
						console.log(res)
						uni.setStorageSync('js_lon', res.longitude);
						uni.setStorageSync('js_lat', res.latitude);
						that.up_address() // 更新技师位置
					},
					fail(res) {
						console.log('获取经纬度失败咯', res)
						// uni.showModal({
						// 	title: '提示',
						// 	content: '获取定位失败，是否授权打开定位',
						// 	success: (res) => {
						// 		if (res.confirm) {
						// 			uni.getSystemInfo({
						// 				success: (sys) => {
						// 					if (sys.platform == 'ios') {
						// 						plus.runtime.openURL("app-settings://");
						// 					} else {
						// 						var main = plus.android
						// 							.runtimeMainActivity();
						// 						var Intent = plus.android.importClass(
						// 							"android.content.Intent");
						// 						//可能应该直接进入应用列表的权限设置？=> android.settings.APPLICATION_SETTINGS  
						// 						var mIntent = new Intent(
						// 							'android.settings.LOCATION_SOURCE_SETTINGS'
						// 							);
						// 						main.startActivity(mIntent);
						// 					}
						// 				}
						// 			})
						// 		}
						// 	}
						// })
					}
				});
			},
			baojing() {
				var that = this
				uni.request({
					url: that.global.url + 'api/qianyu_smfw/technician/police',
					method: 'POST',
					header: {
						'site-id': that.global.site_id,
						'token': uni.getStorageSync('token')
					},
					data: {
						tech_id: that.userinfo.tech_id,
						lon: uni.getStorageSync('js_lon'),
						lat: uni.getStorageSync('js_lat')
					},
					success(res) {
						let result = res.data
						if (result.code == 1) {
							uni.showToast({
								title: '报警成功，请稍等',
								icon: 'none',
								duration: 2000
							})
						} else {
							uni.showToast({
								title: result.msg,
								icon: 'none',
								duration: 2000
							})
						}
					}
				})
			},
			jishi() {
				let that = this
				if (!uni.getStorageSync('token')) {
					// #ifdef APP
					uni.navigateTo({
						url:'/pages/login/login'
					})
					// #endif
					// #ifdef H5
					window.location.href = that.global.url + 'addon/qianyu_smfw/h5/#/pages/login/wxLogin'
					// #endif
				} else {
					console.log(that.userinfo.tech_id)
					if (!that.userinfo.tech_id) {
						that.tiaozhuan('/pages/technician/enter')
						return false
					}
					this.duan = 1
					uni.setStorageSync('duan', 1);
					uni.setStorageSync('tech_id', this.userinfo.tech_id)
					this.get_techinfo() // 获取技师端信息
				}
			},
			daili() {
				var that = this;
				if (!uni.getStorageSync('token')) {
					// #ifdef APP
					uni.navigateTo({
						url:'/pages/login/login'
					})
					// #endif
					// #ifdef H5
					window.location.href = that.global.url + 'addon/qianyu_smfw/h5/#/pages/login/wxLogin'
					// #endif
					return false;
				}
				// 请求获取代理商申请状态
				uni.request({
					url: that.global.url + 'api/qianyu_smfw/agent/agent_status',
					method: 'POST',
					header: {
						'site-id': that.global.site_id,
						'token': uni.getStorageSync('token')
					},
					data: {},
					success(res) {
						let result = res.data
						console.log('你滴，为什么不跳转滴干活',result)
						
						if (result.code == 1) {
							if(result.data ==  0){
								// 未申请代理商
								that.tiaozhuan('/pages/index/league')
							}else if(result.data == 1){
								uni.showToast({
									title:'审核中',
									icon:'none'
								})
							}else if(result.data == 2){
								uni.setStorageSync('agent_id',that.userinfo.agent_id)
								that.tiaozhuan('/pages/agent/agent')
							}
							// if (this.userinfo.agent_id != 0) {
							// 	this.tiaozhuan('/pages/agent/agent')
							// } else {
							// 	this.tiaozhuan('/pages/index/league')
							// }
						}
					},
					complete() {
						uni.hideLoading()
					}
				})
				
				
				
				
			},
			hehuo() {
				var that = this;
				if (!uni.getStorageSync('token')) {
					// #ifdef APP
					uni.navigateTo({
						url:'/pages/login/login'
					})
					// #endif
					// #ifdef H5
					window.location.href = that.global.url + 'addon/qianyu_smfw/h5/#/pages/login/wxLogin'
					// #endif
					
				} else if (this.userinfo.distr_id != 0) {
					this.tiaozhuan('/pages/partner/wode')
				} else {
					this.tiaozhuan('/pages/index/distributor')
				}
			},
			getUser() {
				var that = this
				uni.showLoading({
					title: '加载中...'
				})
				uni.request({
					url: that.global.url + 'api/qianyu_smfw/user/userinfo',
					method: 'POST',
					header: {
						'site-id': that.global.site_id,
						'token': uni.getStorageSync('token')
					},
					data: {},
					success(res) {
						let result = res.data
						if (result.code == 1) {
							that.userinfo = result.data
							if (that.duan == 1) {
								uni.setStorageSync('tech_id', that.userinfo.tech_id)
								that.get_techinfo() // 获取技师端信息
							}
						} else {
							that.userinfo = ''
							// 存用户信息
							uni.removeStorageSync('token')
							uni.removeStorageSync('code')
							console.log(uni.getStorageSync('token'))
							uni.setStorageSync('cdx', 1)
							uni.setStorageSync('duan', 0);
							uni.showToast({
								title: result.msg,
								icon: 'none',
								duration: 2000
							})
						}
					},
					complete() {
						uni.hideLoading()
					}
				})
			},
			// 获取状态栏高度
			geStatusBarHeight() {
				return uni.getSystemInfoSync()['statusBarHeight']
			},
			tiaozhuan(url) {
				var that = this;
				if (!uni.getStorageSync('token')) {
					// #ifdef H5
						window.location.href = that.global.url + 'addon/qianyu_smfw/h5/#/pages/login/wxLogin'
					// #endif
					// #ifdef APP
						uni.navigateTo({
							url: '/pages/login/login'
						})
					// #endif
					
				} else {
					uni.navigateTo({
						url: url
					})
				}
			},

			get_techinfo() {
				var that = this
				uni.showLoading({
					title: '加载中...'
				})
				console.log('技师ID', uni.getStorageSync('tech_id'))
				uni.request({
					url: that.global.url + 'api/qianyu_smfw/tech/tech_index',
					method: 'POST',
					header: {
						'site-id': that.global.site_id,
						'token': uni.getStorageSync('token')
					},
					data: {
						tech_id: uni.getStorageSync('tech_id')
					},
					success(res) {
						let result = res.data
						console.log(result)
						if (result.code == 1) {
							that.tech_info = result.data
							that.getDeingwei()
							that.up_address() // 更新技师位置
							// that.userinfo = result.data
						} else {
							// that.userinfo = ''
							uni.showToast({
								title: result.msg,
								icon: 'none',
								duration: 2000
							})
						}
					},
					complete() {
						uni.hideLoading()
					}
				})
			},

			/* 
			 技师位置更新
			 */
			up_address() {
				var that = this
				uni.showLoading({
					title: '加载中...'
				})
				console.log('获取的技师位置', uni.getStorageSync('js_lon'))
				console.log('技师ID', uni.getStorageSync('tech_id'))
				uni.request({
					url: that.global.url + 'api/qianyu_smfw/tech/tech_position_update',
					method: 'POST',
					header: {
						'site-id': that.global.site_id,
						'token': uni.getStorageSync('token')
					},
					data: {
						tech_id: uni.getStorageSync('tech_id'),
						lon: uni.getStorageSync('js_lon'),
						lat: uni.getStorageSync('js_lat'),
					},
					success(res) {
						let result = res.data
						console.log(result)
						if (result.code == 1) {
							that.tech_info.address = result.data.address
							that.tech_info.lon = result.data.lon
							that.tech_info.lat = result.data.lat
							// that.userinfo = result.data
						} else {
							// that.userinfo = ''
							uni.showToast({
								title: result.msg,
								icon: 'none',
								duration: 2000
							})
						}
					},
					complete() {
						uni.hideLoading()
					}
				})
			}


		}
	}
</script>

<style>
	.content {}

	.div {
		padding: 6rpx 15rpx;
		background-color: #BFF1CA;
	}

	.tim1 {
		padding: 15rpx;
		background-color: #00C82D;
		border-radius: 5rpx;
	}

	.butt2 {
		width: 125rpx;
		height: 50rpx;
		background-color: #00C82D;
		border-radius: 5rpx;
	}
</style>